3.140 \(\int \coth ^2(c+d x) (a+b \tanh ^2(c+d x)) \, dx\)

Optimal. Leaf size=18 \[ x (a+b)-\frac {a \coth (c+d x)}{d} \]

[Out]

(a+b)*x-a*coth(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3629, 8} \[ x (a+b)-\frac {a \coth (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Coth[c + d*x]^2*(a + b*Tanh[c + d*x]^2),x]

[Out]

(a + b)*x - (a*Coth[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3629

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[
((A*b^2 + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*
Tan[e + f*x])^(m + 1)*Simp[a*(A - C) - (A*b - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] &&
 NeQ[A*b^2 + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \coth ^2(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=-\frac {a \coth (c+d x)}{d}-\int (-a-b) \, dx\\ &=(a+b) x-\frac {a \coth (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.03, size = 32, normalized size = 1.78 \[ b x-\frac {a \coth (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};\tanh ^2(c+d x)\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Coth[c + d*x]^2*(a + b*Tanh[c + d*x]^2),x]

[Out]

b*x - (a*Coth[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, Tanh[c + d*x]^2])/d

________________________________________________________________________________________

fricas [B]  time = 0.40, size = 38, normalized size = 2.11 \[ -\frac {a \cosh \left (d x + c\right ) - {\left ({\left (a + b\right )} d x + a\right )} \sinh \left (d x + c\right )}{d \sinh \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)^2*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-(a*cosh(d*x + c) - ((a + b)*d*x + a)*sinh(d*x + c))/(d*sinh(d*x + c))

________________________________________________________________________________________

giac [A]  time = 0.17, size = 30, normalized size = 1.67 \[ \frac {{\left (d x + c\right )} {\left (a + b\right )} - \frac {2 \, a}{e^{\left (2 \, d x + 2 \, c\right )} - 1}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)^2*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

((d*x + c)*(a + b) - 2*a/(e^(2*d*x + 2*c) - 1))/d

________________________________________________________________________________________

maple [A]  time = 0.21, size = 28, normalized size = 1.56 \[ \frac {a \left (d x +c -\coth \left (d x +c \right )\right )+\left (d x +c \right ) b}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(coth(d*x+c)^2*(a+b*tanh(d*x+c)^2),x)

[Out]

1/d*(a*(d*x+c-coth(d*x+c))+(d*x+c)*b)

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 31, normalized size = 1.72 \[ a {\left (x + \frac {c}{d} + \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} - 1\right )}}\right )} + b x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)^2*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

a*(x + c/d + 2/(d*(e^(-2*d*x - 2*c) - 1))) + b*x

________________________________________________________________________________________

mupad [B]  time = 1.27, size = 25, normalized size = 1.39 \[ x\,\left (a+b\right )-\frac {2\,a}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(coth(c + d*x)^2*(a + b*tanh(c + d*x)^2),x)

[Out]

x*(a + b) - (2*a)/(d*(exp(2*c + 2*d*x) - 1))

________________________________________________________________________________________

sympy [B]  time = 7.56, size = 49, normalized size = 2.72 \[ a \left (\begin {cases} \tilde {\infty } x & \text {for}\: c = \log {\left (- e^{- d x} \right )} \vee c = \log {\left (e^{- d x} \right )} \\x \coth ^{2}{\relax (c )} & \text {for}\: d = 0 \\x - \frac {1}{d \tanh {\left (c + d x \right )}} & \text {otherwise} \end {cases}\right ) + b \left (\begin {cases} x & \text {for}\: \left |{x}\right | < 1 \\{G_{2, 2}^{1, 1}\left (\begin {matrix} 1 & 2 \\1 & 0 \end {matrix} \middle | {x} \right )} + {G_{2, 2}^{0, 2}\left (\begin {matrix} 2, 1 & \\ & 1, 0 \end {matrix} \middle | {x} \right )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)**2*(a+b*tanh(d*x+c)**2),x)

[Out]

a*Piecewise((zoo*x, Eq(c, log(exp(-d*x))) | Eq(c, log(-exp(-d*x)))), (x*coth(c)**2, Eq(d, 0)), (x - 1/(d*tanh(
c + d*x)), True)) + b*Piecewise((x, Abs(x) < 1), (meijerg(((1,), (2,)), ((1,), (0,)), x) + meijerg(((2, 1), ()
), ((), (1, 0)), x), True))

________________________________________________________________________________________